// 连接数据库
var mysql = require('mysql')
var connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: '250190',
  database: 'tengxun'
})

connection.connect()

connection.query('select *from user where id=1', function (
  error,
  result,
  fields
) {
  if (error) throw error;
  console.log('this solution is:', result[0].name)
  console.log('数据库连接成功')
})
